<?php
namespace Admin\Controller;

class ConfController extends Controller {

    public function index() {
        $conf = D2()->load();

        $this->assign('record', $conf)->display();
    }

    public function doSave() {
        $m = D2();
        $d = I('post.');

        try {
            $r = $m->save2($d) ? array('s' => true, 'm' => '保存成功') : array('s' => false, 'm' => '保存出错');
        } catch(Exception $e) {
            $r = array('s' => false, 'm' => $e->getMessage());
        }

        showJson($r);
    }

}
